About HTML
- HTML stands for HyperText Markup Language
- It is the standard language used to create and structure the content of a webpage.
- HyperText: This refers to the ability to create links that connect web pages to one another, making the web a connected "web" of information
- Markup Language: This means you use "tags" to surround your content, giving that content meaning and structure. You are "marking up" a plain text document.
1.The Heading:
What it is:
Headings are tags used to define titles and subtitles on your page. They are crucial for creating a logical hierarchy and outline for your content.
- h1:- The most important heading, typically used only once per page for the main title.
- h2:- A major section heading.
- h3:-A sub-section heading under an h2.
- ...and so on, down to h6, the least important heading.
2.The Paragraph:
What it is:
The paragraph tag is the most common tag you'll use. It's for grouping sentences and blocks of text together.
The Purpose:
To define a distinct paragraph of text. Browsers automatically add a little bit of space before and after a element, separating it from other content.
3.HTML Horizontal Lines:
The hr tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
The element is used to separate content (or define a change) in an HTML page:
4.The Line Break tag(br):
- Purpose: Creates a single line break.
- Example:codeHtml
6.List Elements (ul,ol,li)
What it is:
These tags are used to create lists. This is a perfect example of nesting.
The Tags:
- ul: An Unordered List. It creates a bulleted list.
- ol: An Ordered List. It creates a numbered list.
- li: A List Item. Each item in either type of list must be wrapped in an li tag
The Purpose-
To group related items together in a list format.
The Anchor Tag (a):
What it is:
- The Anchor tag is what makes the web "hypertext."
- It is used to create a hyperlink to another webpage, a file, or a location within the same page.
The purpose:
To make text (or an image) clickable, allowing users to navigate. It requires an attribute called href (hypertext reference) to specify the destination URL.
HTML Links - The target Attribute
By default, the linked page will be displayed in the current browser window.
To change this, you must specify another target for the link.
- The target attribute specifies where to open the linked document.
- _self - Default. Opens the document in the same window/tab as it was clicked.
- _blank - Opens the document in a new window or tab.
The target attribute can have one of the following values:
7.The Image Tag(img):
What it is:
The Image tag is a self-closing tag used to embed an image onto your page.
The Purpose:
To display a visual image. It requires two main attributes
- src (source): The path or URL to the image file. This is mandatory.
- alt (alternative text): A description of the image. This is vital for accessibility (screen readers for the visually impaired will read this out) and for when the image fails to load.